AC_INIT(tppmc, 0.0, alan.dion@gmail.com)

AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(tppmc.cc)

AM_INIT_AUTOMAKE

AC_PROG_CXX
AC_PROG_F77
AC_PROG_LIBTOOL

AC_F77_LIBRARY_LDFLAGS


CFLAGS="-Wall -O2 ${CFLAGS}"
CXXFLAGS="-Wall -O2 ${CXXFLAGS}"
LDFLAGS="${LDFLAGS} -L`root-config --libdir`"
LIBS="${LIBS}"
CPPFLAGS="${CPPFLAGS} -I`root-config --incdir`"
FFLAGS="${FFLAGS}"


AC_SUBST(PYTHIA_LIBS)

AC_ARG_WITH(
  Pythia6-lib-path,
  AS_HELP_STRING(
    [--with-Pythia6-lib-path=DIR],
    [location of the libPythia6 library]
  ),
  [PYTHIA_LIBS="-L$withval -lPythia6"],
  [PYTHIA_LIBS='-lPythia6']
)

AC_SUBST(LHAPDF_LIBS)

AC_ARG_WITH(
  lhapdf-libdir,
  AS_HELP_STRING(
    [--with-lhapdf-libdir=DIR],
    [location of libLHAPDF]
  ),
  [LHAPDF_LIBS="-L$withval -lLHAPDF"],
  [LHAPDF_LIBS=""]
)
AM_CONDITIONAL([ENABLE_LHAPDF_SUPPORT], [test x"$LHAPDF_LIBS" != x""])

AC_SUBST(LHAPDF_INCDIR)

AC_ARG_WITH(
  lhapdf-incdir,
  AS_HELP_STRING(
    [--with-lhapdf-incidr=DIR],
    [location of LHAPDF header directory]
  ),
  [LHAPDF_INCDIR="-I$withval -DUSING_LHAPDF"],
  [LHAPDF_INCDIR=""]
)

AC_SUBST(F_LIBS)

AC_ARG_WITH(
  FLIBS-value,
  AS_HELP_STRING(
    [--with-FLIBS-value=value],
    [value to substitute for FLIBS]
  ),
  [F_LIBS="$withval"],
  [F_LIBS='${FLIBS}']
)




AC_CONFIG_FILES([Makefile])





AC_OUTPUT
